<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateWorkersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('workers', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('workerName')->unique('workers_workername_unique');
			$table->string('workerCode')->unique('workers_workercode_unique');
			$table->string('workerSex')->nullable();
			$table->string('workerAge')->nullable();
			$table->float('workerWage', 10, 0)->nullable();
			$table->integer('workshopId')->nullable();
			$table->integer('machineId')->nullable();
			$table->string('machineName', 50)->nullable();
			$table->string('workerWageType')->nullable();
			$table->string('workerJobs')->nullable();
			$table->string('workerJobsType')->nullable();
			$table->integer('workerInWork')->nullable()->default(0);
			$table->string('workerNotes')->nullable();
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('workers');
	}

}
